<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ tag language="java" pageEncoding="UTF-8" body-content="empty" trimDirectiveWhitespaces="true" %>
<%@ attribute name="id" type="java.lang.String" required="true"	description="id" %>
<%@ attribute name="url" type="java.lang.String" required="true" description="url" %>
<%@ attribute name="textKey" type="java.lang.String" required="true" description="textKey" %>
<%@ attribute name="valueKey" type="java.lang.String" required="true" description="textKey" %>
<%@ attribute name="name" type="java.lang.String" required="false" description="name属性" %>
<%@ attribute name="className" type="java.lang.String" required="false" description="class属性" %>
<%@ attribute name="showSelectAll" type="java.lang.Boolean" required="false" description="是否显示选择所有选项，默认false"%>
<%@ attribute name="showSelectName" type="java.lang.String" required="false" description="选择所有选项的名称，默认为'全部'，设置此选项需先设置showSelectAll为'true'"%>
<%@ attribute name="showSelectValue" type="java.lang.String" required="false" description="选择所有选项的值，默认为空，设置此选项需先设置showSelectAll为'true'"%>
<%@ attribute name="onSuccess" type="java.lang.String" required="false" description="下拉标签初始化完成后绑定事件"%>
<%@ attribute name="readonly" type="java.lang.Boolean" required="false" description="是否禁用输入"%>
<%@ attribute name="defaultValue" type="java.lang.String" required="false" description="默认值"%>
<%@ attribute name="defaultIndex" type="java.lang.Integer" required="false" description="默认选中第几项"%>
<%@ attribute name="onSelected" type="java.lang.String" required="false" description="选中时的回调函数，select值发生变化时触发，onSuccess(data,status,xhr)"%>
<%@ attribute name="silent" type="java.lang.Boolean" required="false" description="是否静默查询"%>
<div id='${id}'></div>
<script type="text/javascript"> 
(function(){
	$("div#${id}:not([data-tag='done'])").dropSelectList({
		'contentDefine':{
			'textKey':'${textKey}',
			'valueKey':'${valueKey}'
		},
		'id':'${id}',
		'name':'${name}',
		'className':'${className}',
		'onSuccess':'${onSuccess}',
		'url':'${url}',
		'showSelectAll':'${showSelectAll}',
		'showSelectName':'${showSelectName}',
		'showSelectValue':'${showSelectValue}',
		'readonly':'${readonly}',
		'defaultValue':'${defaultValue}',
		'onSelected':'${onSelected}',
		'silent':'${silent}'
	});
	$("div#${id}").attr({
		'data-tag':'done'
	});
})();
</script>